package com.stu.manager.handler;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.stu.manager.config.Result;
import com.stu.manager.personnel.entity.SysStudent;
import com.stu.manager.personnel.mapper.SysStudentMapper;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@Component
public  class LoginHandler{

    @Resource
    private SysStudentMapper studentMapper;

    public Integer verifyUser(HttpServletRequest request){
        String header = request.getHeader("X-Token");
        QueryWrapper<SysStudent> wrapper = new QueryWrapper<>();
        wrapper.eq("stu_number",header);
        Integer count = studentMapper.selectCount(wrapper);
        return count;
    }

}
